import {request} from "@umijs/max";

export async function getAllFeedbacks(params: FEEDBACK.GetFeedbacksParams, options?: { [key: string]: any }) {
  // 将 params 对象转换为查询字符串
  const queryString = new URLSearchParams(params as any).toString();

  return request<{
    data: FEEDBACK.GetFeedbacksResult
  }>(`/feedback/searchFeedback?${queryString}`, {
    method: 'GET',
    ...(options || {}),
  });
}

export async function processFeedback(params: {[key: string]: any}, options?: { [key: string]: any }) {
  return request<{
    data: API.ApiResult
  }>(`/feedback/handleFeedback`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: params,
    // data: {
    //   ...params
    // },
    ...(options || {}),
  });
}
